<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Gramos - Admin Dashboard</title>

    <!-- begin::global styles -->
    <link rel="stylesheet" href="assets/vendors/bundle.css" type="text/css">
    <!-- end::global styles -->

    <!-- begin::custom styles -->
    <link rel="stylesheet" href="assets/css/app.css" type="text/css">
    <link rel="stylesheet" href="assets/css/custom.css" type="text/css">
    <!-- end::custom styles -->

</head>
<body>

<!-- begin::page loader-->
<div class="page-loader">
    <div class="spinner-border"></div>
    <span>Loading ...</span>
</div>
<!-- end::page loader -->

<!-- begin::sidebar -->
<div class="sidebar">
    <ul class="nav nav-pills nav-justified m-b-30" id="pills-tab" role="tablist">
        <li class="nav-item">
            <a class="nav-link" id="notifications-tab" data-toggle="pill" href="#notifications" role="tab"
               aria-controls="notifications" aria-selected="false">
                <i class="fa fa-bell"></i>
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link" id="settings-tab" data-toggle="pill" href="#settings" role="tab"
               aria-controls="settings" aria-selected="false">
                <i class="ti-settings"></i>
            </a>
        </li>
    </ul>
    <div class="tab-content" id="pills-tabContent">
        <div class="tab-pane" id="notifications" role="tabpanel" aria-labelledby="notifications-tab">
            <div class="tab-pane-body">
                <h5 class="font-weight-bold m-b-20">Notifications</h5>
                <div>
                    <p class="text-muted">Today</p>
                    <ul class="list-group list-group-flush m-b-10">
                        <li class="list-group-item d-flex p-l-r-0">
                            <div>
                                <figure class="avatar avatar-xs m-r-10">
                                    <span class="avatar-title bg-success rounded-circle">A</span>
                                </figure>
                            </div>
                            <div>
                                <p class="m-b-0">
                                    <span class="badge small badge-danger">New</span>
                                    New fundProduct registration.
                                </p>
                                <ul class="list-inline small">
                                    <li class="list-inline-item text-muted">8 minute ago</li>
                                    <li class="list-inline-item">
                                        <a href="#">Mark Read</a>
                                    </li>
                                    <li class="list-inline-item">
                                        <a href="#">View</a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                        <li class="list-group-item d-flex p-l-r-0">
                            <div>
                                <figure class="avatar avatar-xs m-r-10">
                                    <span class="avatar-title rounded-circle">
                                        <i class="fa fa-cloud-upload"></i>
                                    </span>
                                </figure>
                            </div>
                            <div>
                                <p class="m-b-0">Files uploaded successfully.</p>
                                <ul class="list-inline small">
                                    <li class="list-inline-item text-muted">50 minute ago</li>
                                    <li class="list-inline-item">
                                        <a href="#">Mark Read</a>
                                    </li>
                                    <li class="list-inline-item">
                                        <a href="#">View</a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
                <div>
                    <p class="text-muted">Yesterday</p>
                    <ul class="list-group list-group-flush m-b-10">
                        <li class="list-group-item d-flex p-l-r-0">
                            <div>
                                <figure class="avatar avatar-xs m-r-10">
                                    <span class="avatar-title bg-warning rounded-circle">V</span>
                                </figure>
                            </div>
                            <div>
                                <p class="m-b-0">New fundProduct registration.</p>
                                <ul class="list-inline small">
                                    <li class="list-inline-item text-muted">5 hours ago</li>
                                    <li class="list-inline-item">
                                        <a href="#">Mark Read</a>
                                    </li>
                                    <li class="list-inline-item">
                                        <a href="#">View</a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                        <li class="list-group-item d-flex p-l-r-0">
                            <div>
                                <figure class="avatar avatar-xs m-r-10">
                                    <span class="avatar-title rounded-circle">
                                        <i class="fa fa-file-o"></i>
                                    </span>
                                </figure>
                            </div>
                            <div>
                                <p class="m-b-0">Your invoice prepared.</p>
                                <ul class="list-inline small">
                                    <li class="list-inline-item text-muted">10 hours ago</li>
                                    <li class="list-inline-item">
                                        <a href="#">Mark Read</a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                        <li class="list-group-item d-flex p-l-r-0">
                            <div>
                                <figure class="avatar avatar-xs m-r-10">
                                    <span class="avatar-title rounded-circle">
                                        <i class="fa fa-cloud-upload"></i>
                                    </span>
                                </figure>
                            </div>
                            <div>
                                <p class="m-b-0">Files uploaded successfully.</p>
                                <ul class="list-inline small">
                                    <li class="list-inline-item text-muted">16 hours ago</li>
                                    <li class="list-inline-item">
                                        <a href="#">Mark Read</a>
                                    </li>
                                    <li class="list-inline-item">
                                        <a href="#">View</a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="tab-pane-footer">
                <a href="#" class="btn btn-primary btn-block">Mark All Read</a>
            </div>
        </div>
        <div class="tab-pane" id="settings" role="tabpanel" aria-labelledby="settings-tab">
            <div class="tab-pane-body">
                <div class="m-b-30">
                    <h5 class="font-weight-bold m-b-20">Settings</h5>
                    <h6 class="font-weight-bold">System</h6>
                    <ul class="list-group list-group-flush">
                        <li class="list-group-item d-flex justify-content-between p-l-r-0">
                            <span>Automatic updates</span>
                            <div class="custom-control custom-switch">
                                <input type="checkbox" class="custom-control-input" id="customSwitch1" checked>
                                <label class="custom-control-label" for="customSwitch1"></label>
                            </div>
                        </li>
                        <li class="list-group-item d-flex justify-content-between p-l-r-0">
                            <span>Current statistics</span>
                            <div class="custom-control custom-switch">
                                <input type="checkbox" class="custom-control-input" id="customSwitch2" checked>
                                <label class="custom-control-label" for="customSwitch2"></label>
                            </div>
                        </li>
                        <li class="list-group-item d-flex justify-content-between p-l-r-0">
                            <span>User suggestions</span>
                            <div class="custom-control custom-switch">
                                <input type="checkbox" class="custom-control-input" id="customSwitch3" checked>
                                <label class="custom-control-label" for="customSwitch3"></label>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="m-b-30">
                    <h6 class="font-weight-bold">Accout</h6>
                    <ul class="list-group list-group-flush">
                        <li class="list-group-item d-flex justify-content-between p-l-r-0">
                            <span>Senior account security</span>
                            <div class="custom-control custom-switch">
                                <input type="checkbox" class="custom-control-input" id="customSwitch4">
                                <label class="custom-control-label" for="customSwitch4"></label>
                            </div>
                        </li>
                        <li class="list-group-item d-flex justify-content-between p-l-r-0">
                            <span>Account protection</span>
                            <div class="custom-control custom-switch">
                                <input type="checkbox" class="custom-control-input" id="customSwitch5" checked>
                                <label class="custom-control-label" for="customSwitch5"></label>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="m-b-30">
                    <h6 class="font-weight-bold">Notifications</h6>
                    <ul class="list-group list-group-flush">
                        <li class="list-group-item d-flex justify-content-between p-l-r-0">
                            <span>Browser notifications</span>
                            <div class="custom-control custom-switch">
                                <input type="checkbox" class="custom-control-input" id="customSwitch6">
                                <label class="custom-control-label" for="customSwitch6"></label>
                            </div>
                        </li>
                        <li class="list-group-item d-flex justify-content-between p-l-r-0">
                            <span>Mobile notifications</span>
                            <div class="custom-control custom-switch">
                                <input type="checkbox" class="custom-control-input" id="customSwitch7">
                                <label class="custom-control-label" for="customSwitch7"></label>
                            </div>
                        </li>
                        <li class="list-group-item d-flex justify-content-between p-l-r-0">
                            <span>Email subscription</span>
                            <div class="custom-control custom-switch">
                                <input type="checkbox" class="custom-control-input" id="customSwitch8">
                                <label class="custom-control-label" for="customSwitch8"></label>
                            </div>
                        </li>
                        <li class="list-group-item d-flex justify-content-between p-l-r-0">
                            <span>Sms notifications</span>
                            <div class="custom-control custom-switch">
                                <input type="checkbox" class="custom-control-input" id="customSwitch9" checked>
                                <label class="custom-control-label" for="customSwitch9"></label>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="tab-pane-footer">
                <a href="#" class="btn btn-primary btn-block">Save Settings</a>
            </div>
        </div>
    </div>
</div>
<!-- end::sidebar -->

<!-- begin::side menu -->
<jsp:include page="menu.jsp"></jsp:include>
<!-- end::side menu -->

<!-- begin::navbar -->
<nav class="navbar">
<div class="container-fluid">

<%--    adminTitleLogo  begin    --%>
<jsp:include page="TitleLogo.jsp"></jsp:include>
<%--    adminTitleLogo  end    --%>

<div class="header-body">
<ul class="navbar-nav">
    <li class="nav-item dropdown d-none d-lg-block">
        <a href="#" class="nav-link" data-toggle="dropdown">
            <i class="fa fa-th-large"></i>
        </a>
        <div class="dropdown-menu dropdown-menu-big dropdown-menu-nav-grid">
            <div class="dropdown-menu-title">Quick menu</div>
            <div class="dropdown-menu-body">
                <div class="nav-grid">
                    <div class="nav-grid-row">
                        <a href="#" class="nav-grid-item">
                            <i class="fa fa-address-book-o"></i>
                            <span>App</span>
                        </a>
                        <a href="#" class="nav-grid-item">
                            <i class="fa fa-envelope-o"></i>
                            <span>Mail</span>
                        </a>
                    </div>
                    <div class="nav-grid-row">
                        <a href="#" class="nav-grid-item">
                            <i class="fa fa-sticky-note"></i>
                            <span>Chat</span>
                        </a>
                        <a href="#" class="nav-grid-item">
                            <i class="fa fa-dashboard"></i>
                            <span>Dashboard</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </li>
</ul>
<c:if test="${nowAdmin!=null}">

            <%--       搜索的表单、包含分页跳转查询     --%>
            <%--    管理员search功能     --%>
            <c:if test="${nowAdmin!=null}">
            <form id="search" action="/SsmDemo/queryFundProduct" class="search">
                </c:if>
            <%--    普通用户search功能    --%>
            <c:if test="${nowUser!=null}">
                <form id="search" action="/SsmDemo/userQueryFundProduct" class="search">
                    </c:if>

                <div class="input-group">
                    <input id="pageNo" type="hidden" name="pageNo" value="1">
                    <input type="text" class="form-control" placeholder="Search ..."
                           aria-label="Recipient's username"
                           aria-describedby="button-addon2">
                    <div class="input-group-append">
                        <button class="btn" type="button" id="button-addon2">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>
                </div>
            </form>
            <%--       搜索的表单、包含分页跳转查询     --%>
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a href="#" class="d-lg-none d-sm-block nav-link search-panel-open">
                        <i class="fa fa-search"></i>
                    </a>
                </li>
                <li class="nav-item dropdown">
                    <a href="#" class="nav-link nav-link-notify" data-toggle="dropdown">
                        <i class="fa fa-envelope"></i>
                    </a>
                    <div class="dropdown-menu dropdown-menu-right dropdown-menu-big">
                        <div class="dropdown-menu-title d-flex justify-content-between">
                            <div>
                                <h6 class="text-uppercase font-size-12 m-b-0">Messages</h6>
                                <small class="font-size-11 opacity-7">1 unread messages</small>
                            </div>
                        </div>
                        <div class="dropdown-menu-body">
                            <ul class="list-group list-group-flush">
                                <a href="#" class="list-group-item d-flex link-1 hide-show-toggler">
                                    <div>
                                        <figure class="avatar avatar-sm m-r-15">
                                            <span class="avatar-title bg-success rounded-circle">M</span>
                                        </figure>
                                    </div>
                                    <div class="flex-grow-1">
                                        <h6 class="m-b-0 d-flex justify-content-between">
                                            Malanie Hanvey
                                            <i title="Read Mark" data-toggle="tooltip"
                                               class="hide-show-toggler-item fa fa-check font-size-11"></i>
                                        </h6>
                                        <span class="text-muted m-r-10 small">PM 08:50</span>
                                        <span class="text-muted small">Have you mad...</span>
                                    </div>
                                </a>
                                <a href="#" class="list-group-item d-flex link-1 bg-light hide-show-toggler">
                                    <div>
                                        <figure class="avatar avatar-sm m-r-15">
                                            <span class="avatar-title bg-primary rounded-circle">TB</span>
                                        </figure>
                                    </div>
                                    <div class="flex-grow-1">
                                        <h6 class="m-b-0 d-flex justify-content-between">
                                            Kenneth Hune
                                            <i title="Read Mark" data-toggle="tooltip"
                                               class="hide-show-toggler-item fa fa-circle-o font-size-11"></i>
                                        </h6>
                                        <span class="text-muted m-r-10 small">PM 10:23</span>
                                        <span class="text-muted small">I have a meetin...</span>
                                    </div>
                                </a>
                                <a href="#" class="list-group-item d-flex align-items-center link-1 hide-show-toggler">
                                    <div>
                                        <figure class="avatar avatar-sm m-r-15">
                                            <span class="avatar-title bg-danger rounded-circle">M</span>
                                        </figure>
                                    </div>
                                    <div class="flex-grow-1">
                                        <h6 class="m-b-0 d-flex justify-content-between">
                                            Kevin added
                                            <i title="Read Mark" data-toggle="tooltip"
                                               class="hide-show-toggler-item fa fa-check font-size-11"></i>
                                        </h6>
                                        <span class="text-muted m-r-10 small">PM 08:50</span>
                                        <span class="text-muted small">Have you mad...</span>
                                    </div>
                                </a>
                                <a href="#" class="list-group-item d-flex align-items-center link-1 hide-show-toggler">
                                    <div>
                                        <figure class="avatar avatar-sm m-r-15">
                                            <span class="avatar-title bg-info rounded-circle">KC</span>
                                        </figure>
                                    </div>
                                    <div class="flex-grow-1">
                                        <h6 class="m-b-0 d-flex justify-content-between">
                                            Katherine Ember
                                            <i title="Read Mark" data-toggle="tooltip"
                                               class="hide-show-toggler-item fa fa-check font-size-11"></i>
                                        </h6>
                                        <span class="text-muted m-r-10 small">PM 20:13</span>
                                        <span class="text-muted small">I have a meetin...</span>
                                    </div>
                                </a>
                            </ul>
                        </div>
                        <div class="dropdown-menu-footer text-right">
                            <ul class="list-inline small">
                                <li class="list-inline-item">
                                    <a href="#">Mark All Read</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </li>
                <li class="nav-item">
                    <a href="#" class="nav-link nav-link-notify sidebar-open" data-sidebar-target="#notifications">
                        <i class="fa fa-bell"></i>
                    </a>
                </li>
                <li class="nav-item dropdown">
                    <a href="#" data-toggle="dropdown">
                        <figure class="avatar avatar-sm avatar-state-success">
                            <img class="rounded-circle" src="assets/media/image/avatar.jpg" alt="...">
                        </figure>
                    </a>
                    <div class="dropdown-menu dropdown-menu-right">
                        <a href="profile.html" class="dropdown-item">Profile</a>
                        <a href="#" data-sidebar-target="#settings" class="sidebar-open dropdown-item">Settings</a>
                        <div class="dropdown-divider"></div>
                        <a href="login.html" class="text-danger dropdown-item">Logout</a>
                    </div>
                </li>
                <li class="nav-item d-lg-none d-sm-block">
                    <a href="#" class="nav-link side-menu-open">
                        <i class="ti-menu"></i>
                    </a>
                </li>
            </ul>
        </div>

    </div>
</nav>
<!-- end::navbar -->

<!-- begin::main content -->
<main class="main-content">

    <div class="container-fluid">

        <!-- begin::page header -->
        <div class="page-header d-md-flex justify-content-between align-items-center">
            <%--标题--%>
            <h4>理财基金列表</h4>
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb m-t-0">
                    <li class="breadcrumb-item"><a href="#">Dashboard</a></li>
                    <li class="breadcrumb-item"><a href="#">UI Elements</a></li>
                    <li class="breadcrumb-item"><a href="#">Tables</a></li>
                    <li class="breadcrumb-item active" aria-current="page">Basic Tables</li>
                </ol>
            </nav>
        </div>
        <!-- end::page header -->

        <div class="row">
            <div class="col-md-12">
        <%--    用户模态框    --%>
        <c:if test="${nowUser!=null}">
        <div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog"
             aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
                    <form action="/SsmDemo/insertUserFundProductUser" method="post">
                        <div class="modal-header">
                            <h5 class="modal-title" id="exampleModalCenterTitle">发起基金定投</h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <%--             用户id（隐藏输入）                   --%>
                            <input type="hidden" name="userid" value="${nowUser.id}"/>
                            <input type="hidden" name="fundid" id="fundid" value=""/>

                            <div class="form-group mb-4">
                                定投基金名称：
                                <div class="col-md-4" id="fundName">
                                    广发多元新兴股票<%--                 默认输入                           --%>
                                </div>
                            </div>
                            <div class="form-group mb-4">
                                起投时间：
                                <div class="col-md-4">
                                    <input type="date" name="starttime" class="form-control">
                                </div>
                            </div>
                            <div class="form-group mb-4">
                                结束时间：
                                <div class="col-md-4">
                                    <input type="date" name="endtime" class="form-control">
                                </div>
                            </div>

                        </div>
                        <div class="modal-footer">
                            <%--                                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close--%>
                            <%--                                    </button>--%>
                            <button type="submit" class="btn btn-primary">Save changes</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        </c:if>
        <%--    用户模态框    --%>
                <div class="card">
                    <div class="card-body">
                        第${pageInfo.pageNum}页
                        <div class="table-responsive">
                            <table class="table">
                                <thead>
                                <%-- 标题 --%>
                                <%--             根据FundProduct类设计输出                   --%>
                                <tr>
                                    <th scope="col">id</th>
                                    <th scope="col">基金类型</th>
                                    <th scope="col">基金代码</th>
                                    <th scope="col">基金简称</th>
                                    <th scope="col">日增长率</th>
                                    <th scope="col">起投金额</th>
                                    <th scope="col">收益</th>
                                    <th scope="col">投资期限</th>
                                    <th class="text-right" scope="col">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <%--items表示为数据源  var表示临时变量--%>
                                <c:forEach items="${list}" var="fundProductItem">
                                    <tr>
                                        <th scope="row">${fundProductItem.id}</th>
                                        <td>
                                            <c:if test="${fundProductItem.type==1}">
                                                股票型基金
                                            </c:if>
                                            <c:if test="${fundProductItem.type==2}">
                                                债卷型基金
                                            </c:if>
                                            <c:if test="${fundProductItem.type==3}">
                                                货币型基金
                                            </c:if>
                                            <c:if test="${fundProductItem.type==4}">
                                                混合型基金
                                            </c:if>
                                        </td>
                                        <td>${fundProductItem.code}</td>
                                        <td>${fundProductItem.funddesc}</td>
                                        <td>${fundProductItem.dailygrowth}</td>
                                        <td>${fundProductItem.leastmoney}</td>
                                        <td>${fundProductItem.profit}</td>
                                        <td>${fundProductItem.investerm}</td>
                                        <td class="text-right">
                                            <%--    用户button    --%>
                                            <c:if test="${nowUser!=null}">
                                                <button type="button"
                                                        onclick="selectedFund('${fundProductItem.id}','${fundProductItem.funddesc}')"<%--onclick之后传入参数--%>
                                                        class="btn btn-primary" data-toggle="modal"
                                                        data-target="#exampleModalCenter">选中定投
                                                </button>
                                            </c:if>
                                             <%--    用户button    --%>
                                             <%--    用户button    --%>
                                             <c:if test="${nowAdmin!=null}">
                                             <div class="dropdown">
                                                 <a href="#" class="btn btn-light btn-floating btn-icon btn-sm"
                                                    data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                     <i class="fa fa-ellipsis-v" aria-hidden="true"></i>
                                                 </a>
                                                 <div class="dropdown-menu dropdown-menu-right">
                                                     <a href="/SsmDemo/toUpdateFundProduct?id=${fundProductItem.id}"> <button class="dropdown-item" type="button">修改</button></a>
                                                     <a href="/SsmDemo/deleteFundProduct?id=${fundProductItem.id}"> <button class="dropdown-item" type="button">删除</button></a>
                                                 </div>
                                             </div>
                                             </c:if>
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>


                        </div>
                    </div>

                </div>
                <%--      分页标签          --%>
                <nav aria-label="Page navigation example" class="mb-3">
                    <ul class="pagination justify-content-center">
                        <li class="page-item">
                            <a class="page-link" href="javascript:jump(1)">首页</a>
                        </li>
                        <li class="page-item">
                            <a class="page-link" href="javascript:jump(${pageInfo.prePage})">上一页</a>
                        </li>
                        <li class="page-item">
                            <a class="page-link" href="javascript:jump(${pageInfo.pageNum})">${pageInfo.pageNum}</a>
                        </li>
                        <li class="page-item">
                            <a class="page-link" href="javascript:jump(${pageInfo.nextPage})">下一页</a>
                        </li>
                        <li class="page-item">
                            <a class="page-link" href="javascript:jump(${pageInfo.pages})">尾页</a>
                        </li>
                    </ul>
                </nav>
                <%--      分页标签          --%>
                <%--  javascript  --%>
                <script>
                    //提供一个函数
                    function jump(page){
                        //1、修改表单中page的value值
                        document.getElementById("pageNo").value = page;
                        //2、提交表单请求
                        document.getElementById("search").submit();
                    }
                    //提供一个函数用于获取当前选中定投的基金id和基金名(相当于修改参数)
                    function selectedFund(id, name) {
                        // console.log("id=" + id);
                        // console.log("name=" + name);
                        $('#fundid').attr('value', id);
                        $('#fundName').text(name);
                    }
                </script>
            </div>
        </div>

    </div>

</main>
<!-- end::main content -->

<!-- begin::global scripts -->
<script src="assets/vendors/bundle.js"></script>
<!-- end::global scripts -->


<!-- begin::datepicker -->
<script src="assets/vendors/datepicker/daterangepicker.js"></script>
<script src="assets/js/examples/datepicker.js"></script>
<!-- end::datepicker -->


<!-- begin::custom scripts -->
<script src="assets/js/custom.js"></script>
<script src="assets/js/app.js"></script>
<
</body>
</html></c:if>


    <c:if test="${nowUser!=null}">

            <%--       搜索的表单、包含分页跳转查询     --%>
            <form id="search" action="/SsmDemo/userQueryFundProduct" class="search">
                <div class="input-group">
                    <input id="pageNo" type="hidden" name="pageNo" value="1">
                    <input type="text" class="form-control" placeholder="Search ..."
                           aria-label="Recipient's username"
                           aria-describedby="button-addon2">
                    <div class="input-group-append">
                        <button class="btn" type="button" id="button-addon2">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>
                </div>
            </form>
            <%--       搜索的表单、包含分页跳转查询     --%>
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a href="#" class="d-lg-none d-sm-block nav-link search-panel-open">
                        <i class="fa fa-search"></i>
                    </a>
                </li>
                <li class="nav-item dropdown">
                    <a href="#" class="nav-link nav-link-notify" data-toggle="dropdown">
                        <i class="fa fa-envelope"></i>
                    </a>
                    <div class="dropdown-menu dropdown-menu-right dropdown-menu-big">
                        <div class="dropdown-menu-title d-flex justify-content-between">
                            <div>
                                <h6 class="text-uppercase font-size-12 m-b-0">Messages</h6>
                                <small class="font-size-11 opacity-7">1 unread messages</small>
                            </div>
                        </div>
                        <div class="dropdown-menu-body">
                            <ul class="list-group list-group-flush">
                                <a href="#" class="list-group-item d-flex link-1 hide-show-toggler">
                                    <div>
                                        <figure class="avatar avatar-sm m-r-15">
                                            <span class="avatar-title bg-success rounded-circle">M</span>
                                        </figure>
                                    </div>
                                    <div class="flex-grow-1">
                                        <h6 class="m-b-0 d-flex justify-content-between">
                                            Malanie Hanvey
                                            <i title="Read Mark" data-toggle="tooltip"
                                               class="hide-show-toggler-item fa fa-check font-size-11"></i>
                                        </h6>
                                        <span class="text-muted m-r-10 small">PM 08:50</span>
                                        <span class="text-muted small">Have you mad...</span>
                                    </div>
                                </a>
                                <a href="#" class="list-group-item d-flex link-1 bg-light hide-show-toggler">
                                    <div>
                                        <figure class="avatar avatar-sm m-r-15">
                                            <span class="avatar-title bg-primary rounded-circle">TB</span>
                                        </figure>
                                    </div>
                                    <div class="flex-grow-1">
                                        <h6 class="m-b-0 d-flex justify-content-between">
                                            Kenneth Hune
                                            <i title="Read Mark" data-toggle="tooltip"
                                               class="hide-show-toggler-item fa fa-circle-o font-size-11"></i>
                                        </h6>
                                        <span class="text-muted m-r-10 small">PM 10:23</span>
                                        <span class="text-muted small">I have a meetin...</span>
                                    </div>
                                </a>
                                <a href="#" class="list-group-item d-flex align-items-center link-1 hide-show-toggler">
                                    <div>
                                        <figure class="avatar avatar-sm m-r-15">
                                            <span class="avatar-title bg-danger rounded-circle">M</span>
                                        </figure>
                                    </div>
                                    <div class="flex-grow-1">
                                        <h6 class="m-b-0 d-flex justify-content-between">
                                            Kevin added
                                            <i title="Read Mark" data-toggle="tooltip"
                                               class="hide-show-toggler-item fa fa-check font-size-11"></i>
                                        </h6>
                                        <span class="text-muted m-r-10 small">PM 08:50</span>
                                        <span class="text-muted small">Have you mad...</span>
                                    </div>
                                </a>
                                <a href="#" class="list-group-item d-flex align-items-center link-1 hide-show-toggler">
                                    <div>
                                        <figure class="avatar avatar-sm m-r-15">
                                            <span class="avatar-title bg-info rounded-circle">KC</span>
                                        </figure>
                                    </div>
                                    <div class="flex-grow-1">
                                        <h6 class="m-b-0 d-flex justify-content-between">
                                            Katherine Ember
                                            <i title="Read Mark" data-toggle="tooltip"
                                               class="hide-show-toggler-item fa fa-check font-size-11"></i>
                                        </h6>
                                        <span class="text-muted m-r-10 small">PM 20:13</span>
                                        <span class="text-muted small">I have a meetin...</span>
                                    </div>
                                </a>
                            </ul>
                        </div>
                        <div class="dropdown-menu-footer text-right">
                            <ul class="list-inline small">
                                <li class="list-inline-item">
                                    <a href="#">Mark All Read</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </li>
                <li class="nav-item">
                    <a href="#" class="nav-link nav-link-notify sidebar-open" data-sidebar-target="#notifications">
                        <i class="fa fa-bell"></i>
                    </a>
                </li>
                <li class="nav-item dropdown">
                    <a href="#" data-toggle="dropdown">
                        <figure class="avatar avatar-sm avatar-state-success">
                            <img class="rounded-circle" src="assets/media/image/avatar.jpg" alt="...">
                        </figure>
                    </a>
                    <div class="dropdown-menu dropdown-menu-right">
                        <a href="profile.html" class="dropdown-item">Profile</a>
                        <a href="#" data-sidebar-target="#settings" class="sidebar-open dropdown-item">Settings</a>
                        <div class="dropdown-divider"></div>
                        <a href="login.html" class="text-danger dropdown-item">Logout</a>
                    </div>
                </li>
                <li class="nav-item d-lg-none d-sm-block">
                    <a href="#" class="nav-link side-menu-open">
                        <i class="ti-menu"></i>
                    </a>
                </li>
            </ul>
        </div>

    </div>
</nav>
<!-- end::navbar -->

<!-- begin::main content -->
<main class="main-content">

    <div class="container-fluid">

        <!-- begin::page header -->
        <div class="page-header d-md-flex justify-content-between align-items-center">
            <%--标题--%>
            <h4>理财基金列表</h4>
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb m-t-0">
                    <li class="breadcrumb-item"><a href="#">Dashboard</a></li>
                    <li class="breadcrumb-item"><a href="#">UI Elements</a></li>
                    <li class="breadcrumb-item"><a href="#">Tables</a></li>
                    <li class="breadcrumb-item active" aria-current="page">Basic Tables</li>
                </ol>
            </nav>
        </div>
        <!-- end::page header -->

        <div class="row">
            <div class="col-md-12">
                <%--      模态框          --%>
                <div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog"
                     aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
                    <div class="modal-dialog modal-dialog-centered" role="document">
                        <div class="modal-content">
                            <form action="/SsmDemo/insertUserFundProductUser" method="post">
                                <div class="modal-header">
                                    <h5 class="modal-title" id="exampleModalCenterTitle">发起基金定投</h5>
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                </div>
                                <div class="modal-body">
                                    <%--             用户id（隐藏输入）                   --%>
                                    <input type="hidden" name="userid" value="${nowUser.id}"/>
                                    <input type="hidden" name="fundid" id="fundid" value=""/>

                                    <div class="form-group mb-4">
                                        定投基金名称：
                                        <div class="col-md-4" id="fundName">
                                            广发多元新兴股票<%--                 默认输入                           --%>
                                        </div>
                                    </div>
                                    <div class="form-group mb-4">
                                        起投时间：
                                        <div class="col-md-8">
                                            <input type="datetime-local" name="starttime" class="form-control">
                                        </div>
                                    </div>
                                    <div class="form-group mb-4">
                                        结束时间：
                                        <div class="col-md-8">
                                            <input type="datetime-local" name="endtime" class="form-control">
                                        </div>
                                    </div>

                                </div>
                                <div class="modal-footer">
                                    <%--                                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close--%>
                                    <%--                                    </button>--%>
                                    <button type="submit" class="btn btn-primary">Save changes</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <%--      模态框          --%>
                <div class="card">
                    <div class="card-body">
                        第${pageInfo.pageNum}页
                        <div class="table-responsive">
                            <table class="table">
                                <thead>
                                <%-- 标题 --%>
                                <%--             根据FundProduct类设计输出                   --%>
                                <tr>
                                    <th scope="col">id</th>
                                    <th scope="col">基金类型</th>
                                    <th scope="col">基金代码</th>
                                    <th scope="col">基金简称</th>
                                    <th scope="col">日增长率</th>
                                    <th scope="col">起投金额</th>
                                    <th scope="col">收益</th>
                                    <th scope="col">投资期限</th>
                                    <%--                                    <th class="text-right" scope="col">操作</th>--%>
                                </tr>
                                </thead>
                                <tbody>
                                <%--items表示为数据源  var表示临时变量--%>
                                <c:forEach items="${list}" var="fundProductItem">
                                    <tr>
                                        <th scope="row">${fundProductItem.id}</th>

                                        <td>
                                            <c:if test="${fundProductItem.type==1}">
                                                股票型基金
                                            </c:if>
                                            <c:if test="${fundProductItem.type==2}">
                                                债卷型基金
                                            </c:if>
                                            <c:if test="${fundProductItem.type==3}">
                                                货币型基金
                                            </c:if>
                                            <c:if test="${fundProductItem.type==4}">
                                                混合型基金
                                            </c:if>
                                        </td>

                                        <td>${fundProductItem.code}</td>
                                        <td>${fundProductItem.funddesc}</td>
                                        <td>${fundProductItem.dailygrowth}</td>
                                        <td>${fundProductItem.leastmoney}</td>
                                        <td>${fundProductItem.profit}</td>
                                        <td>${fundProductItem.investerm}</td>
                                        <td class="text-right">
                                            <button type="button"
                                                    onclick="selectedFund('${fundProductItem.id}','${fundProductItem.funddesc}')"<%--onclick之后传入参数--%>
                                                    class="btn btn-primary" data-toggle="modal"
                                                    data-target="#exampleModalCenter">选中定投
                                            </button>
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                        </div>
                    </div>

                </div>
                <%--      分页标签          --%>
                <nav aria-label="Page navigation example" class="mb-3">
                    <ul class="pagination justify-content-center">
                        <li class="page-item">
                            <a class="page-link" href="javascript:jump(1)">首页</a>
                        </li>
                        <li class="page-item">
                            <a class="page-link" href="javascript:jump(${pageInfo.prePage})">上一页</a>
                        </li>
                        <li class="page-item">
                            <a class="page-link" href="javascript:jump(${pageInfo.pageNum})">${pageInfo.pageNum}</a>
                        </li>
                        <li class="page-item">
                            <a class="page-link" href="javascript:jump(${pageInfo.nextPage})">下一页</a>
                        </li>
                        <li class="page-item">
                            <a class="page-link" href="javascript:jump(${pageInfo.pages})">尾页</a>
                        </li>
                    </ul>
                </nav>
                <%--      分页标签          --%>
                <%--  javascript  --%>
                <script>
                    //提供一个函数
                    function jump(page){
                        //1、修改表单中page的value值
                        document.getElementById("pageNo").value = page;
                        //2、提交表单请求
                        document.getElementById("search").submit();
                    }
                    //提供一个函数用于获取当前选中定投的基金id和基金名(相当于修改参数)
                    function selectedFund(id, name) {
                        // console.log("id=" + id);
                        // console.log("name=" + name);
                        $('#fundid').attr('value', id);
                        $('#fundName').text(name);
                    }
                </script>
            </div>
        </div>

    </div>

</main>
<!-- end::main content -->

<!-- begin::global scripts -->
<script src="assets/vendors/bundle.js"></script>
<!-- end::global scripts -->


<!-- begin::datepicker -->
<script src="../assets/vendors/datepicker/daterangepicker.js"></script>
<script src="../assets/js/examples/datepicker.js"></script>
<!-- end::datepicker -->


<!-- begin::custom scripts -->
<script src="assets/js/custom.js"></script>
<script src="assets/js/app.js"></script>
<!-- end::custom scripts -->

</body>
</html>
    </c:if>